﻿/**************************************************************
* Copyright (C) 2022 www.eipflow.com 孙泽伟版权所有(盗版必究)
*
* 作者: 孙泽伟(QQ 1039318332)
* 创建时间: 2022/01/12 22:40:15
* 文件名: 
* 描述: 
* 
* 修改历史
* 修改人：
* 时间：
* 修改说明：
*
**************************************************************/
namespace EIP.System.Logic
{
    /// <summary>
    /// 工作表操作
    /// </summary>
    public interface ISystemWorkSheetLogic
    {
        #region 表操作
        /// <summary>
        /// 否存在
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<bool>> TableExist(SystemWorkSheetTableExistInput input);

        /// <summary>
        /// 创建表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache,ISystemConfigLogic_Cache")]
        OperateStatus Table(SystemWorkSheetTableInput input);

        /// <summary>
        /// 修改表别名称
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache,ISystemConfigLogic_Cache")]
        OperateStatus TableRename(SystemWorkSheetTableInput input);

        /// <summary>
        /// 保存表字段
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus> TableField(SystemWorkSheetTableFieldInput input);

        /// <summary>
        /// 删除表字段
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus> TableFieldDelete(SystemWorkSheetTableFieldInput input);
        #endregion

        #region 数据操作


        /// <summary>
        /// 保存表单数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<object>> Save(SystemWorkSheetSaveInput input);

        /// <summary>
        /// 复制数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus> Copy(SystemWorkSheetCopyInput input);

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<IDictionary<string, object>>> FindById(SystemWorkSheetFindByIdInput input);

        /// <summary>
        /// 获取业务数据
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<dynamic>> Find(SystemWorkSheetFindPagingInput paging);

        /// <summary>
        /// 获取关联表业务数据默认值
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<dynamic>> FindCorrelationDefault(SystemWorkSheetFindCorrelationDefaultFieldInput input);

        /// <summary>
        /// 获取关联表业务数据默认值
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<dynamic>> FindCorrelationDefaultField(SystemWorkSheetFindCorrelationDefaultFieldInput input);

        /// <summary>
        /// 获取关联表业务数据默认值
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        //[EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<dynamic>> FindCorrelationDefaultWorkSheet(SystemWorkSheetFindCorrelationDefaultWorkSheetInput input);

        /// <summary>
        /// 获取关联表业务数据
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<dynamic>> FindCorrelationRows(SystemWorkSheetFindCorrelationRowsInput input);

        /// <summary>
        /// 获取关联表业务数据
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<dynamic>> FindCorrelationFilter(SystemWorkSheetFindCorrelationFilterInput input);

        /// <summary>
        /// 获取关联表业务数据
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<dynamic>> FindCorrelationFilterAll(SystemWorkSheetFindCorrelationFilterAllInput input);

        /// <summary>
        /// 查询字段值唯一
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus> CheckOnly(SystemZeroCodeOnlyInput input);

        /// <summary>
        /// 获取左侧查询
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<List<SystemWorkSheetFilterSearchOutput>>> FindFilterSearch(SystemWorkSheetFilterSearchInput paging);

        /// <summary>
        /// 获取表尾数据
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        [EasyCachingAble(CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus<dynamic>> FindFooter(SystemWorkSheetFindFooterInput paging);

        /// <summary>
        /// 删除业务数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus> Delete(SystemWorkSheetDeleteInput input);

        /// <summary>
        /// 删除业务数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus> DeletePhysics(SystemWorkSheetDeleteInput input);

        /// <summary>
        /// 删除业务数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus> DeletePhysicsAll(IdInput input);

        /// <summary>
        /// 恢复删除业务数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task<OperateStatus> RecoveryDeletePhysics(SystemWorkSheetDeleteInput input);

        /// <summary>
        /// 刷新关联数据
        /// </summary>
        /// <param name="griggerZeroCodeId"></param>
        /// <param name="key"></param>
        /// <param name="rowId"></param>
        /// <param name="afterData"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        Task SetReloadLink(Guid griggerZeroCodeId, string key, Guid rowId, object afterData, List<string> updateSqls);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="doSqls"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        [EasyCachingEvict(IsAll = true, CacheKeyPrefix = "ISystemWorkSheetLogic_Cache")]
        OperateStatus<object> SaveDoSqls(List<string> doSqls, Dictionary<string, object> parameters);
        #endregion
    }
}